home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / wcl-21.lha / wcl-2.1 / src / compiler / common / configurations.lisp < prev    next >
Lisp/Scheme  |  1992-09-10  |  6KB  |  232 lines

  1. ;;; (C) Copyright 1990-1992 by Wade L. Hennessey. All rights reserved.
  2.  
  3. (defvar *root-directory* nil)
  4.  
  5. (defstruct (config (:print-function print-config))
  6.   name
  7.   cc-debug-info?
  8.   (cc-optimizer-level 1)
  9.   indirect-calls?
  10.   argc-check?
  11.   full-type-checking?
  12.   structure-type-checking?
  13.   array-bounds-checking?
  14.   inline-calls?
  15.   remove-tail-recursion?
  16.   fold-constants?
  17.   beta?
  18.   improve?
  19.   misc-speed-hacks?
  20.   lisp-line-numbers?)
  21.  
  22. (defun print-config (config stream depth)
  23.   (declare (ignore depth))
  24.   (format stream "#<config ~A>" (config-name config)))
  25.  
  26. (defparameter *default-config*
  27.   (make-config :name "DEFAULT"
  28.            :cc-debug-info? t
  29.            :cc-optimizer-level 1
  30.            :argc-check? t
  31.            :full-type-checking? t  
  32.            :structure-type-checking? nil
  33.            :array-bounds-checking? t
  34.            :inline-calls? t
  35.            :misc-speed-hacks? t
  36.            :improve? t
  37.            :beta? t
  38.            :fold-constants? t
  39.            :remove-tail-recursion? t
  40.            :indirect-calls? t))
  41.  
  42. (defparameter *fastest-config*
  43.   (make-config :name "FASTEST"
  44.            :cc-debug-info? t
  45.            :cc-optimizer-level 2
  46.            :argc-check? nil
  47.            :full-type-checking? nil
  48.            :structure-type-checking? nil
  49.            :array-bounds-checking? nil
  50.            :inline-calls? t
  51.            :misc-speed-hacks? t
  52.            :beta? t
  53.            :improve? t
  54.            :fold-constants? t
  55.            :remove-tail-recursion? t
  56.            :indirect-calls? t))    ; maybe make this NIL...
  57.  
  58. (defparameter *debug-library-config*
  59.   (make-config :name "Debug Library"
  60.            :cc-debug-info? t
  61.            :cc-optimizer-level 2
  62.            :argc-check? t
  63.            :full-type-checking? t
  64.            :structure-type-checking? nil
  65.            :array-bounds-checking? nil
  66.            :inline-calls? t
  67.            :misc-speed-hacks? t
  68.            :improve? t
  69.            :beta? t
  70.            :fold-constants? t
  71.            :remove-tail-recursion? t
  72.            :indirect-calls? t))
  73.  
  74. (defparameter *standard-library-config*
  75.   (make-config :name "Standard Library"
  76.            :cc-debug-info? nil
  77.            :cc-optimizer-level 2
  78.            :argc-check? t
  79.            :full-type-checking? t
  80.            :structure-type-checking? nil
  81.            :array-bounds-checking? nil
  82.            :inline-calls? t
  83.            :misc-speed-hacks? t
  84.            :beta? t
  85.            :improve? t
  86.            :fold-constants? t
  87.            :remove-tail-recursion? t
  88.            :indirect-calls? t))    ; HEY! make this NIL when refs resolve
  89.  
  90. (defparameter *delivery-library-config*
  91.   (make-config :name "Delivery Library"
  92.            :cc-debug-info? nil
  93.            :cc-optimizer-level 2
  94.            :argc-check? nil
  95.            :full-type-checking? nil
  96.            :structure-type-checking? nil
  97.            :array-bounds-checking? nil
  98.            :inline-calls? t
  99.            :misc-speed-hacks? t
  100.            :beta? t
  101.            :improve? t
  102.            :fold-constants? t
  103.            :remove-tail-recursion? t
  104.            :indirect-calls? nil))
  105.  
  106. (defparameter *config* *default-config*)
  107.  
  108. (defvar *link-every-symbol?* t)
  109.  
  110. (defvar *profile?* nil)
  111.  
  112. (defstruct c-compiler
  113.   command
  114.   (debug-switch "-g")
  115.   optimizer-switches
  116.   debug-optimized?
  117.   position-independent-code-switch
  118.   ansi-var-args?
  119.   ansi-fixed-args?)
  120.  
  121. (defparameter *gcc*
  122.   (make-c-compiler
  123.    :command "gcc -w"
  124.    :optimizer-switches #("" "-O" "-O2")
  125.    :debug-optimized? t
  126.    :position-independent-code-switch "-fPIC"))
  127.  
  128. (defparameter *sun-cc*
  129.   (make-c-compiler
  130.    ;; BARF! fill in name field at init time to avoid tmp dir lossage 
  131.    :command nil
  132.    :optimizer-switches #("" "-O" "-O2")    ; 04 causes signal handler problems
  133.    :debug-optimized? nil
  134.    :position-independent-code-switch "-PIC"))
  135.  
  136. (defparameter *mips-cc*
  137.   (make-c-compiler
  138.    ;; Table size lossage
  139.    :command "cc -Wf,-XNp40000 -Wf,-XNd20000 -Wf,-XNc100 -Wf,-XNj40"
  140.    :optimizer-switches #("" "-O" "-O4")
  141.    :debug-optimized? nil
  142.    :position-independent-code-switch "-PIC"
  143.    :ansi-var-args? t
  144.    :ansi-fixed-args? t))
  145.  
  146. (defstruct machine
  147.    name 
  148.    processor
  149.    operating-system
  150.    c-compiler
  151.    linker-command
  152.    shared-libraries
  153.    link-libraries)
  154.  
  155. (defparameter *sparcstation-gcc*
  156.   (make-machine
  157.    :name "SparcStation (gcc)"
  158.    :processor "sparc"
  159.    :operating-system "SunOS"
  160.    :c-compiler *gcc*
  161.    :linker-command "gcc "        ; -n -Bdynamic for smallest image
  162.    :shared-libraries t
  163.    :link-libraries "-lm"))
  164.  
  165. ;;; lucid cc 
  166. ;;; (format nil "/home/wade/bin/lcc -w -Xtemp=~/tmp ")
  167.  
  168. (defparameter *sparcstation-cc*
  169.   (make-machine
  170.    :name "SparcStation (cc)"
  171.    :processor "sparc"
  172.    :operating-system "SunOS"
  173.    :c-compiler *sun-cc*
  174.    :linker-command "cc"            ; -n -Bdynamic for smallest image
  175.    :shared-libraries t
  176.    :link-libraries "-lm"))
  177.  
  178. (defparameter *decstation*
  179.   (make-machine
  180.    :name "DecStation"
  181.    :processor "mips"
  182.    :operating-system "Ultrix"
  183.    ;; Table size lossage
  184.    :c-compiler *mips-cc*
  185.    :linker-command "cc -Wl,-n -Wl,-D -Wl,A000000 "
  186.    :shared-libraries nil
  187.    :link-libraries "-lm -lexc"))
  188.  
  189. (defvar *target-machine* nil)
  190.  
  191. (defvar *compiler-version*
  192.   #+NATIVE-WCL #.(library-version (lookup-library :com)))
  193.  
  194. (defvar *compiler-build-date*
  195.   #+NATIVE-WCL #.(with-output-to-string (x) (print-time :stream x)))
  196.  
  197. ;;; System loading
  198.  
  199. (defun root-load (f)
  200.   (print (load (format nil "~A/~A" *root-directory* f))))
  201.     
  202. (defun load-pprint ()
  203.   (root-load "src/cl/pprint/package-setup")
  204.   (root-load "src/cl/pprint/globals")
  205.   (root-load "src/cl/pprint/interface")
  206.   (root-load "src/cl/pprint/format-compiler")
  207.   (root-load "src/cl/pprint/formats")
  208.   (root-load "src/cl/pprint/initialize")
  209.   (gc)
  210.   (warn "Pretty Printer loaded into XP package~%"))
  211.  
  212. (defun load-clos ()
  213.   (root-load "src/pcl/setup")
  214.   (root-load "src/pcl/defsys")
  215.   (warn "If you enter GDB with the message: Too many open files.")
  216.   (warn "please type `continue'")
  217.   (let ((pcl (find-package "PCL")))
  218.     ;; Weirdness to get PCL running correctly
  219.     (funcall (intern "LOAD-PCL" pcl))
  220.     (eval `(,(intern "DEFCLASS" pcl) lisp::fixup () (x)))
  221.     (warn "You are about to enter the debugger. Please `abort' when you do.")
  222.     (warn "After you abort, CLOS will be loaded into the PCL package.~%")
  223.     (gc)
  224.     (funcall (intern "MAKE-INSTANCE" pcl) 'lisp::fixup)))
  225.  
  226. (defun load-logical-pathnames ()
  227.   (root-load "src/misc/logical-pathnames")
  228.   (warn "Logical Pathname functions loaded into the LISP package.~%"))
  229.  
  230.  
  231.  
  232.